package com.googlecode.afdbaccess.config.propertyconfig;

import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;

public class DBCPPoolFactoryForMySql extends DBCPPoolFactoryHelper {
    public DBCPPoolFactoryForMySql() {
        super(3306, "SELECT 1");
    }

    @Override
    protected MysqlDataSource createDataSource() {
        MysqlDataSource dataSource = new MysqlDataSource();
        dataSource.setServerName(serverAddress);
        dataSource.setDatabaseName(serverDatabasename);
        dataSource.setPortNumber(serverPort);
        dataSource.setUser(serverUser);
        dataSource.setPassword(serverPassword);
        return dataSource;
    }
}
